package com.rjwh.dingdong.client.mvp.model.impl;

import com.aishua.lib.task.AsResult;
import com.rjwh.dingdong.client.mvp.BaseModel;
import com.rjwh.dingdong.client.mvp.BasePresenter;
import com.rjwh.dingdong.client.mvp.model.IMorePersonDataModel;
import com.rjwh.dingdong.client.network.ApiRequest;
import com.rjwh.dingdong.client.network.HttpWebServiceCallBack;

/**
 * @author Kay
 * @ClassName MorePersonDataModel
 * @Description
 * @date 2016-8-5
 * @history 2016-8-5 author: description:
 */
public class MorePersonDataModel extends BaseModel implements IMorePersonDataModel, HttpWebServiceCallBack {

    public MorePersonDataModel(BasePresenter basePresenter) {
        super(basePresenter);
    }

    /**
     * 修改用户资料
     *
     * @param value 修改的数据
     * @param type  修改的类型(姓名,年龄等)
     */
    @Override
    public void saveUserData(String value, String type) {
        ApiRequest.saveUserData(value, type, this);
    }

    @Override
    public void onServerDataAcquired(int businessType, AsResult mAsResult, boolean isRefresh) {
        if (getBasePresenter() != null) {
            getBasePresenter().onServerDataAcquired(businessType, mAsResult, isRefresh);
        }
    }
}
